﻿<%@ Page Language="C#" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register src="~/App_Control/Dashboard.ascx" tagname="Dashboard" tagprefix="uc" %>
<%@ Register src="~/App_Control/Alerts.ascx" tagname="Alerts" tagprefix="uc" %>
<%@ Register src="~/App_Control/Tabs.ascx" tagname="Tabs" tagprefix="uc" %>

<style>
.albums
{
	background: #F7F7F7 none repeat scroll 0%;
	magin: 0px;
	padding: 10px 10px 5px;
}
.album
{
	background: white none repeat scroll 0%;
	border: 1px solid #CCCCCC;
	margin: 0px 0px 5px;
	padding: 9px;
}
.album .image
{
	text-align: left;
	vertical-align: top;
	width: 123px;
}
.album .info
{
	vertical-align: top;
	width: 433px;
}
.album .actions
{
	vertical-align: top;
	width: 150px;
}
.album .label 
{
	color: Gray;
	width: 70px;
	padding-right: 5px;
}
.album .name
{
	font-size: 13px;
	font-weight: bold;
}
.album .actions a:hover
{
	background: #3B5998 none repeat scroll 0%;
    color: white;
    text-decoration: none;
}
.album .actions a
{
    border-bottom: 1px solid #D8DFEA;
    display: block;
    margin: 0px;
    padding: 2px 4px;
}
.album tr.description td
{
	vertical-align: top;
}
.album tr.description div
{
	padding-right: 10px;
	width: 300px;
}
</style>

<fb:title>Featured Albums</fb:title>
<uc:Dashboard ID="d" runat="server" />
<uc:Alerts ID="a" runat="server" />
<uc:Tabs ID="t" runat="server" />


<form runat="server" id="f"><asp:GridView ID="gv" runat="server"></asp:GridView></form>

<asp:ListView ID="lvAlbums" runat="server">
    <LayoutTemplate>
        <div class="albums"><asp:PlaceHolder ID="itemContainer" runat="server" /></div>
    </LayoutTemplate>
    <EmptyDataTemplate>
        <div class="albums">
            <fb:explanation>
                <fb:message>You haven't selected any albums to feature.</fb:message>
                Click on the <a href="../select_albums/">Select Albums</a> tab in order 
                to peruse your SmugMug library.
                When you find an album you like, you can add it to your profile and
                it will show up here.
            </fb:explanation>
        </div>
    </EmptyDataTemplate>
    <ItemTemplate>
        <div class="album">
            <table cellpadding="0" border="0">
                <tbody>
                    <tr>
                        <td class="image">
                            <a href="<%#Eval("SmugMugImageLink")%>">
                                <img alt="Click to view on SmugMug" src="<%#Eval("ThumbUrl")%>" width="113" />
                            </a>
                        </td>
                        <td class="info">
                            <table cellpadding="0" cellspacing="0" border="0">
                                <tbody>
                                    <tr>
                                        <td class="label">Title:</td>
                                        <td class="name"><%#Eval("Title")%></td>
                                    </tr>    
                                    <tr>
                                        <td class="label">Last Updated:</td>
                                        <td><%#Eval("LastUpdated")%></td>
                                    </tr>   
                                    <tr>
                                        <td class="label">Size:</td>
                                        <td><%#Eval("ImageCount")%> photos</td>
                                    </tr>  
                                    <tr>
                                        <td style="padding: 0px 70px; font-size: 1px; line-height: 1px; height: 10px;" colspan="2">
                                            <div style="border-bottom: 1px solid rgb(221, 221, 221); height: 5px;"/>
                                        </td>
                                    </tr>     
                                    <tr class="description">
                                        <td class="label">Description:</td>
                                        <td><div><%#Eval("Description")%></div></td>
                                    </tr>                             
                                </tbody>
                            </table>
                        </td>
                        <td class="actions">
                            <a href='<%#Eval("Rank", "/smugmug_on_facebook/featured_albums/remove/?fa={0}")%>'>Remove from Profile</a>
                            <a href='<%#Eval("AlbumId", "/smugmug_on_facebook/featured_albums/choose_photo/?a={0}")%>'>Select New Photo</a>
                            <a href='<%#Eval("SmugMugImageLink")%>'>View on SmugMug</a>
                        </td>
                    </tr>
                </tbody>
            </table>        
        </div>
    </ItemTemplate>
</asp:ListView>

<script runat="server">
protected override void OnLoad(EventArgs e) 
{
    SmfbService smfb = new SmfbService();
    List<CompositeAlbum> list = smfb.GetCompositeAlbums();
    this.lvAlbums.DataSource = list;
    this.lvAlbums.DataBind();
}
</script>